package com.game.commons.scripts.java.impl.javacompiler;

import java.io.File;
import java.io.IOException;

import javax.tools.SimpleJavaFileObject;

import org.apache.commons.io.FileUtils;


/**
 * SimpleJavaFileObject包装类
 * @author 杜祥
 * @create 2013-6-17
 */
public class JavaSourceFromFile extends SimpleJavaFileObject 
{
	
	protected JavaSourceFromFile(File file, Kind kind) 
	{
		super(file.toURI(), kind);
	}

	
	/**
	 * 返回字符串标识的源
	 */
	@Override
	public CharSequence getCharContent(boolean ignoreEncodingErrors)throws IOException 
	{
		return FileUtils.readFileToString(new File(this.toUri()));
	}
	
}
